﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Repetition.Domain;
using System.Xml.Linq;

namespace Repetition.Conversion
{
    public class XmlConverter
    {
        public static void Export(ICollection<Subject> subjects, ICollection<Problem> problems, string filename)
        {
            XElement element = XElementConverter.ToXElement(subjects, problems);
            element.Save(filename);
        }

        public static void Import(string filename, out ICollection<Subject> subjects, out ICollection<Problem> problems)
        {
            XElementConverter.Import(XElement.Load(filename), out subjects, out problems);
        }
    }
}
